home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 2.iso / dist / fw_libxml.idb / usr / freeware / include / gnome-xml / nanoftp.h.z / nanoftp.h
C/C++ Source or Header  |  2001-04-12  |  3KB  |  106 lines

  1. /*
  2.  * nanohttp.c: minimalist FTP implementation to fetch external subsets.
  3.  *
  4.  * See Copyright for the status of this software.
  5.  *
  6.  * Daniel.Veillard@w3.org
  7.  */
  8.  
  9. #ifndef __NANO_FTP_H__
  10. #define __NANO_FTP_H__
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. /**
  16.  * ftpListCallback: 
  17.  * @userData:  user provided data for the callback
  18.  * @filename:  the file name (including "->" when links are shown)
  19.  * @attrib:  the attribute string
  20.  * @owner:  the owner string
  21.  * @group:  the group string
  22.  * @size:  the file size
  23.  * @links:  the link count
  24.  * @year:  the year
  25.  * @month:  the month
  26.  * @day:  the day
  27.  * @hour:  the hour
  28.  * @minute:  the minute
  29.  *
  30.  * A callback for the xmlNanoFTPList command
  31.  * Note that only one of year and day:minute are specified
  32.  */
  33. typedef void (*ftpListCallback) (void *userData,
  34.                              const char *filename, const char* attrib,
  35.                              const char *owner, const char *group,
  36.                  unsigned long size, int links, int year,
  37.                  const char *month, int day, int hour,
  38.                  int minute);
  39. /**
  40.  * ftpDataCallback: 
  41.  * A callback for the xmlNanoFTPGet command
  42.  */
  43. typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
  44.  
  45. /*
  46.  * Init
  47.  */
  48. void    xmlNanoFTPInit        (void);
  49. void    xmlNanoFTPCleanup    (void);
  50.  
  51. /*
  52.  * Creating/freeing contexts
  53.  */
  54. void *    xmlNanoFTPNewCtxt    (const char *URL);
  55. void    xmlNanoFTPFreeCtxt    (void * ctx);
  56. void *     xmlNanoFTPConnectTo    (const char *server,
  57.                  int port);
  58. /*
  59.  * Opening/closing session connections
  60.  */
  61. void *     xmlNanoFTPOpen        (const char *URL);
  62. int    xmlNanoFTPConnect    (void *ctx);
  63. int    xmlNanoFTPClose        (void *ctx);
  64. int    xmlNanoFTPQuit        (void *ctx);
  65. void    xmlNanoFTPScanProxy    (const char *URL);
  66. void    xmlNanoFTPProxy        (const char *host,
  67.                  int port,
  68.                  const char *user,
  69.                  const char *passwd,
  70.                  int type);
  71. int    xmlNanoFTPUpdateURL    (void *ctx,
  72.                  const char *URL);
  73.  
  74. /*
  75.  * Rathern internal commands
  76.  */
  77. int    xmlNanoFTPGetResponse    (void *ctx);
  78. int    xmlNanoFTPCheckResponse    (void *ctx);
  79.  
  80. /*
  81.  * CD/DIR/GET handlers
  82.  */
  83. int    xmlNanoFTPCwd        (void *ctx,
  84.                  char *directory);
  85.  
  86. int    xmlNanoFTPGetConnection    (void *ctx);
  87. int    xmlNanoFTPCloseConnection(void *ctx);
  88. int    xmlNanoFTPList        (void *ctx,
  89.                  ftpListCallback callback,
  90.                  void *userData,
  91.                  char *filename);
  92. int    xmlNanoFTPGetSocket    (void *ctx,
  93.                  const char *filename);
  94. int    xmlNanoFTPGet        (void *ctx,
  95.                  ftpDataCallback callback,
  96.                  void *userData,
  97.                  const char *filename);
  98. int    xmlNanoFTPRead        (void *ctx,
  99.                  void *dest,
  100.                  int len);
  101.  
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105. #endif /* __NANO_FTP_H__ */
  106.